//
//  PersonalPlatform.m
//  reSearchDemo
//
//  Created by 科技 on 15/7/31.
//  Copyright (c) 2015年 Kiwaro. All rights reserved.
//

#import "PersonalPlatform.h"
#import "personalView.h"
#import "EnterpriseView.h"
#import "KLocatePickView.h"
#import "KLocation.h"
#import "CameraActionSheet.h"
#import "VPImageCropperViewController.h"
#import "HTTPGlobals.h"
#import "MBProgressHUD.h"
#import "OnePlatform.h"

static MBProgressHUD *HUD;
@interface PersonalPlatform ()<UITableViewDataSource,UITableViewDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate,CameraActionSheetDelegate,UITextFieldDelegate>
{
    UITableView *_tableView;
    UIView *_headView;
    personalView *personalV;         /**< 个人平台*/
    EnterpriseView *enterpriseV;     /**< 企业平台*/
    BOOL isPerson;
    UIButton *SelectBtn;             /**< 当前选中的按钮*/
    int stateCode;                   /**< 省代号     */
    int cityCode;                    /**< 市代号     */
    NSArray *stateArray;
    NSMutableDictionary *imageDic;   /**< 图片缓存*/
}
@end

@implementation PersonalPlatform

- (PersonalPlatform *)initWithPlatformType:(Platform_Type)type account:(NSString *)account name:(NSString *)name email:(NSString *)email password:(NSString *)password {
    self = [super init];
    if (self) {
        self.platformType = type;
        self.account = account;
        self.name = name;
        self.email = email;
        self.password = password;
    }
    return self;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    imageDic = [NSMutableDictionary dictionary];
    self.view.backgroundColor=[UIColor whiteColor];
    
    [self initMainView];
    
    [self initData];
    
}

- (void)initData {
    [[HTTPGlobals shareHTTPGlobal] GetHTTPRequest:@"MobilePort/Index/regist2.html" parameters:nil finish:^(BOOL seccess, NSString *error, id obj) {
        if (seccess) {
            DLog(@"ID = %@",obj);
            NSArray *cs_data = obj[@"cs_data"];
            NSMutableArray *marray = [NSMutableArray array];
            for (NSDictionary *dic in cs_data) {
                [marray addObject:dic[@"name"]];
            }
            stateArray = marray;
        }
    }];
}

#pragma mark -- 设置主界面 --
- (void)initMainView {
    _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.frame), CGRectGetHeight(self.view.frame)) style:UITableViewStylePlain];
    _tableView.delegate = self;
    _tableView.dataSource = self;

    _tableView.tableFooterView = [[UIView alloc] init];
    [self.view addSubview:_tableView];
    // 通过枚举判断,加载当前页面
    switch (self.platformType) {
        case personalPlatform:
        {
            self.title = @"个人平台";
            _headView = [self personalPlatformView];
            break;
        }
        case EnterprisePlatform:
        {
            self.title = @"企业平台";
            _headView = [self EnterprisePlatformView];
            break;
        }
        case BusinessUnit:
        {
            self.title = @"事业单位";
            _headView = [self BusinessUnitView];
            break;
        }
        case PublicService:
        {
            self.title = @"公共服务";
            _headView = [self PublicServiceView];
            break;
        }
        case BusinessAssociation:
        {
            self.title = @"商协会";
            _headView = [self BusinessAssociationView];
            break;
        }
            
        default:
            break;
    }

}
#pragma mark -- 加载个人平台 --
-(UIView *)personalPlatformView {
    personalV = [personalView instanceView];
    personalV.frame = self.view.frame;
    [personalV.Btn1 addTarget:self action:@selector(CityBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [personalV.Btn2 addTarget:self action:@selector(CityBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [personalV.Btn3 addTarget:self action:@selector(CrameBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [personalV.Btn4 addTarget:self action:@selector(CrameBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [personalV.Btn5 addTarget:self action:@selector(CrameBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [personalV.Btn6 addTarget:self action:@selector(sureBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [personalV.Btn6 backgroundImageForState:UIControlStateNormal];
    return personalV;
}
#pragma mark -- 加载企业平台 --
-(UIView *)EnterprisePlatformView {
    if (enterpriseV) {
        [enterpriseV removeFromSuperview];
        enterpriseV = nil;
    }
    enterpriseV = [EnterpriseView instanceView];
//    enterpriseV.frame = self.view.frame;
    [self setPlatformView:enterpriseV text1:@"企业平台" text2:@"企业资质:" text3:@"单位名称:" text4:@"营业执照号:" text5:@"联系电话:" text6:@"企业住所:" text7:@"营业执照图片:"];
    return enterpriseV;
}
#pragma mark -- 加载商协会 --
-(UIView *)BusinessAssociationView {
    if (enterpriseV) {
        [enterpriseV removeFromSuperview];
        enterpriseV = nil;
    }
    enterpriseV = [EnterpriseView instanceView];
//    enterpriseV.frame = self.view.frame;
    [self setPlatformView:enterpriseV text1:@"商协会平台" text2:@"商协会资质:" text3:@"组织名称:" text4:@"组织执照号:" text5:@"联系电话:" text6:@"组织住所:" text7:@"组织相关证件:"];
    return enterpriseV;
}
#pragma mark -- 加载事业单位 --
-(UIView *)BusinessUnitView {
    if (enterpriseV) {
        [enterpriseV removeFromSuperview];
        enterpriseV = nil;
    }
    enterpriseV = [EnterpriseView instanceView];
//    enterpriseV.frame = self.view.frame;
    [self setPlatformView:enterpriseV text1:@"事业单位平台" text2:@"单位资质:" text3:@"单位名称:" text4:@"单位证件号:" text5:@"联系电话:" text6:@"单位住所:" text7:@"单位相关证件:"];
    return enterpriseV;
}
#pragma mark -- 加载公共服务平台 --
-(UIView *)PublicServiceView {
    if (enterpriseV) {
        [enterpriseV removeFromSuperview];
        enterpriseV = nil;
    }
    enterpriseV = [EnterpriseView instanceView];
//    enterpriseV.frame = self.view.frame;
    [self setPlatformView:enterpriseV text1:@"公共服务平台" text2:@"服务单位资质:" text3:@"服务单位名称:" text4:@"服务单位证件号:" text5:@"联系电话:" text6:@"服务单位住所:" text7:@"服务单位相关证件:"];
    enterpriseV.label3.font = [UIFont systemFontOfSize:12];
    enterpriseV.label4.font = [UIFont systemFontOfSize:12];
    enterpriseV.label5.font = [UIFont systemFontOfSize:12];
    enterpriseV.label6.font = [UIFont systemFontOfSize:12];

    return enterpriseV;
}
#pragma mark -- 修改页面的内容和添加点击事件 --
-(void)setPlatformView:(EnterpriseView *)headView
                 text1:(NSString *)text1
                 text2:(NSString *)text2
                 text3:(NSString *)text3
                 text4:(NSString *)text4
                 text5:(NSString *)text5
                 text6:(NSString *)text6
                 text7:(NSString *)text7 {
    headView.label1.text = text1;
    headView.label2.text = text2;
    headView.label3.text = text3;
    headView.label4.text = text4;
    headView.label5.text = text5;
    headView.label6.text = text6;
    headView.label8.text = text7;
    headView.TF1.delegate = self;
    headView.TF2.delegate = self;
    headView.TF3.delegate = self;
    headView.TF4.delegate = self;
    headView.TF5.delegate = self;
    headView.TF6.delegate = self;
    headView.TF7.delegate = self;
    headView.TF8.delegate = self;
    [headView.Btn1 addTarget:self action:@selector(CityBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [headView.Btn2 addTarget:self action:@selector(CityBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [headView.Btn3 addTarget:self action:@selector(UserCityBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [headView.Btn4 addTarget:self action:@selector(UserCityBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [headView.Btn5 setTitle:@"上传" forState:UIControlStateNormal];
    [headView.Btn5 addTarget:self action:@selector(CrameBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [headView.Btn6 setTitle:@"上传" forState:UIControlStateNormal];
    [headView.Btn6 addTarget:self action:@selector(CrameBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [headView.Btn7 setTitle:@"上传" forState:UIControlStateNormal];
    [headView.Btn7 addTarget:self action:@selector(CrameBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    [headView.Btn8 setTitle:@"上传" forState:UIControlStateNormal];
    [headView.Btn8 addTarget:self action:@selector(CrameBtnAction:) forControlEvents:UIControlEventTouchUpInside];
    
    
    [headView.sureBtn addTarget:self action:@selector(sureBtnAction:) forControlEvents:UIControlEventTouchUpInside];
}
#pragma mark -- 城市按钮响应事件 --
-(void)CityBtnAction:(UIButton *)sender {
    isPerson = NO;
    [self showLoctionPicker];
}
-(void)UserCityBtnAction:(UIButton *)sender {
    isPerson = YES;
    [self showLoctionPicker];
}
#pragma mark -- 弹出城市选择器 --
-(void)showLoctionPicker
{
    KLocatePickView *locateView = [[KLocatePickView alloc] initWithTitle:@"选择城市" delegate:self];
    [locateView updataState:stateArray];
    [locateView showInView:self.view];
}
#pragma mark -- 弹出图片选择器 --
-(void)CrameBtnAction:(UIButton *)sender {
    CameraActionSheet *actionSheet = [[CameraActionSheet alloc] initWithActionTitle:nil TextViews:nil CancelTitle:@"取消" withDelegate:self otherButtonTitles:@"从相册选择", @"拍一张", nil];
    [actionSheet show];
    SelectBtn = sender;
}
#pragma mark -- 确认提交按钮 --
-(void)sureBtnAction:(UIButton *)sender {
    if (self.platformType != personalPlatform) {
        //非个人平台数据检测
        NSString *name = enterpriseV.TF1.text;
        NSString *PersonNumber = enterpriseV.TF2.text;
        NSString *phoneNumber = enterpriseV.TF3.text;
        NSString *region = enterpriseV.TF4.text;
        NSString *str = enterpriseV.TF5.text;
        NSString *str1 = enterpriseV.TF6.text;
        NSString *str2 = enterpriseV.TF7.text;
        NSString *str3 = enterpriseV.TF8.text;
        NSString *btnStr1 = enterpriseV.Btn1.titleLabel.text;
        NSString *btnStr2 = enterpriseV.Btn3.titleLabel.text;
        NSString *btnStr3 = enterpriseV.Btn5.titleLabel.text;
        NSString *btnStr4 = enterpriseV.Btn6.titleLabel.text;
        NSString *btnStr5 = enterpriseV.Btn7.titleLabel.text;
        NSString *btnStr6 = enterpriseV.Btn8.titleLabel.text;
        //输入是否为空
        if (name.length > 0 && PersonNumber.length > 0 && phoneNumber.length > 0 && region.length > 0 && str.length > 0 && str1.length > 0 && str2.length > 0 && str3.length > 0 && btnStr1.length > 0 && btnStr2 > 0 && [btnStr3 isEqualToString:@"已上传"] && [btnStr4 isEqualToString:@"已上传"] && [btnStr5 isEqualToString:@"已上传"] && [btnStr6 isEqualToString:@"已上传"]) {
            
        }else {
            [self showAlert:@"请输入完整数据!" isNeedCancel:NO];
            return;
        }
        //手机号码输入是否正确
        if (![self validPhone:str2]) {
            [self showAlertPrompt:@"输入手机号码有误!" isNeedCancel:NO];
            return;
        }
        //身份证号码输入是否正确
        if (![self validIdentityCard:str1]) {
            [self showAlertPrompt:@"身份证号码输入错误!" isNeedCancel:NO];
            return;
        }
        
        //检测完毕  接口提交数据检测
        [self submitData];
    }else {
        //个人平台数据检测
        NSString *name = personalV.nameTF.text;
        NSString *IDNumberTF = personalV.IDNumberTF.text;
        NSString *phoneNumber = personalV.PhoneNumberTF.text;
        NSString *streetTF = personalV.streetTF.text;
        NSString *btnStr1 = personalV.Btn1.titleLabel.text;
        NSString *btnStr2 = personalV.Btn3.titleLabel.text;
        NSString *btnStr3 = personalV.Btn4.titleLabel.text;
        NSString *btnStr4 = personalV.Btn5.titleLabel.text;
        //输入是否为空
        if (name.length > 0 && IDNumberTF.length > 0 && phoneNumber.length > 0 && streetTF.length > 0 && btnStr1.length > 0 && [btnStr2 isEqualToString:@"已上传"] && [btnStr3 isEqualToString:@"已上传"] && [btnStr4 isEqualToString:@"已上传"]) {
            
        }else {
            [self showAlert:@"请输入完整数据!" isNeedCancel:NO];
            return;
        }
        //手机号码是否有误
        if (![self validPhone:phoneNumber]) {
            [self showAlert:@"输入手机号码有误!" isNeedCancel:NO];
            return;
        }
        //身份证号码是否有误
        if (![self validIdentityCard:IDNumberTF]) {
            [self showAlertPrompt:@"身份证号码输入错误!" isNeedCancel:NO];
            return;
        }
        
        //检测完毕  接口提交数据检测
        [self submitData];
    }
}

- (void)submitData {
    NSArray *imageArray;
    NSArray *nameArray;
    
    NSMutableDictionary *dic = [NSMutableDictionary dictionary];
    [dic setValue:self.account forKey:@"account"];
    [dic setValue:self.name forKey:@"name"];
    [dic setValue:self.email forKey:@"email"];
    [dic setValue:self.password forKey:@"password"];
    
    if (self.platformType != personalPlatform) {
        imageArray = [NSArray arrayWithObjects:
                      imageDic[[[NSNumber alloc] initWithLong:enterpriseV.Btn5.hash]],
                      imageDic[[[NSNumber alloc] initWithLong:enterpriseV.Btn6.hash]],
                      imageDic[[[NSNumber alloc] initWithLong:enterpriseV.Btn7.hash]],
                      imageDic[[[NSNumber alloc] initWithLong:enterpriseV.Btn8.hash]],
                      nil];
        nameArray = [NSArray arrayWithObjects:
                     @"licenseImg",      // 营业执照相片
                     @"identityImg1",    //  身份证正面照片
                     @"identityImg2",    //  身份证背面照片
                     @"identityImg3",    //  手持身份证照片
                     nil];
        
        [dic setValue:[NSString stringWithFormat:@"%d",self.platformType+1] forKey:@"companyNature"];
        [dic setValue:enterpriseV.TF1.text forKey:@"companyName"];   // 企业名
        [dic setValue:enterpriseV.TF2.text forKey:@"companyID"];    // 营业执照号
        [dic setValue:enterpriseV.TF3.text forKey:@"companyPhone"];//联系电话
        [dic setValue:enterpriseV.Btn1.currentTitle forKey:@"province"];    // 企业省份
        [dic setValue:enterpriseV.Btn2.currentTitle forKey:@"city"];      // 企业城市
        [dic setValue:enterpriseV.TF4.text forKey:@"address"];    // 企业地址
        [dic setValue:enterpriseV.TF5.text forKey:@"licenseMan"];    //真实姓名
        [dic setValue:enterpriseV.TF6.text forKey:@"licenseID"];   // 身份证号码
        [dic setValue:enterpriseV.TF7.text forKey:@"licensePhone"];   // 手机号码
        [dic setValue:enterpriseV.Btn3.currentTitle forKey:@"licenseProvince"];     // 省份
        [dic setValue:enterpriseV.Btn4.currentTitle forKey:@"licenseCity"];       // 城市
        [dic setValue:enterpriseV.TF8.text forKey:@"licenseAdress"];      // 地址
    } else {
        imageArray = [NSArray arrayWithObjects:
                      imageDic[[[NSNumber alloc] initWithLong:personalV.Btn3.hash]],
                      imageDic[[[NSNumber alloc] initWithLong:personalV.Btn4.hash]],
                      imageDic[[[NSNumber alloc] initWithLong:personalV.Btn5.hash]],
                      nil];
        nameArray = [NSArray arrayWithObjects:
                     @"identityImg1",    //  身份证正面照片
                     @"identityImg2",    //  身份证背面照片
                     @"identityImg3",    //  手持身份证照片
                     nil];
        
        [dic setValue:[NSString stringWithFormat:@"%d",self.platformType+1] forKey:@"companyNature"];
        [dic setValue:personalV.nameTF.text forKey:@"licenseMan"];    //真实姓名
        [dic setValue:personalV.IDNumberTF.text forKey:@"licenseID"];   // 身份证号码
        [dic setValue:personalV.PhoneNumberTF.text forKey:@"licensePhone"];   // 手机号码
        [dic setValue:personalV.Btn1.currentTitle forKey:@"licenseProvince"];     // 省份
        [dic setValue:personalV.Btn2.currentTitle forKey:@"licenseCity"];       // 城市
        [dic setValue:personalV.streetTF.text forKey:@"licenseAdress"];      // 地址
    }
    
    [self setLoading:YES];
    [[HTTPGlobals shareHTTPGlobal] uploadImageWithUrl:@"MobilePort/Index/commitRenzheng.html" imageArr:imageArray imageNameArr:nameArray parameters:dic finish:^(BOOL seccess, NSError *error, id obj) {
        [self setLoading:NO];
        if (seccess) {
            [self showText:obj[@"msg"]];
            if ([obj[@"code"] isEqualToString:@"0"]) {
                [self showText:@"注册成功"];
                [self popToViewController:[OnePlatform class]];
            }
        }else {
            [self showAlertPrompt:@"网络请求失败!" isNeedCancel:NO];
        }
    }];
}

#pragma mark -- 判断手机号码 --
- (BOOL) validPhone:(NSString *)phone {
    NSString * regex=@"^[1][3578]+\\d{9}";
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
    return [predicate evaluateWithObject:phone];
}

- (BOOL) validIdentityCard:(NSString *)number {
    NSString *regex = @"^(\\d{14}|\\d{17})(\\d|[xX])$";
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regex];
    return [predicate evaluateWithObject:number];
}

#pragma mark -- 选择城市的回调 --
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    if(buttonIndex == 1) {
        
        KLocatePickView *locateView = (KLocatePickView *)actionSheet;
        KLocation *location = locateView.locate;
        if (self.platformType > 0) {
            if (isPerson) {
                [enterpriseV.Btn3 setTitle:location.state forState:UIControlStateNormal];
                [enterpriseV.Btn4 setTitle:location.city forState:UIControlStateNormal];
            }else {
                [enterpriseV.Btn1 setTitle:location.state forState:UIControlStateNormal];
                [enterpriseV.Btn2 setTitle:location.city forState:UIControlStateNormal];
            }
            
        }else {
            [personalV.Btn1 setTitle:location.state forState:UIControlStateNormal];
            [personalV.Btn2 setTitle:location.city forState:UIControlStateNormal];
        }
    }
}
#pragma mark -- CameraActionSheetDelegate --
- (void)cameraActionSheet:(CameraActionSheet *)sender didDismissWithButtonIndex:(NSInteger)buttonIndex
{
    if (buttonIndex == 2) {
        return;
    }
    UIImagePickerController * picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;
    if (buttonIndex == 0){
        picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
    } else if (buttonIndex == 1) {
        if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
            
            picker.sourceType = UIImagePickerControllerSourceTypeCamera;
        } else {
        //                [self showText:@"无法打开相机"];
        }
    }
    [self presentModalController:picker animated:YES];
}
#pragma mark -- UIImagePickerControllerDelegate --
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    [picker dismissViewControllerAnimated:YES completion:^() {
        UIImage * img = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
        img = [UIImage rotateImage:img];
        VPImageCropperViewController *imgCropperVC = [[VPImageCropperViewController alloc] initWithImage:img cropFrame:CGRectMake((self.view.frame.size.width - 240)/2, 100.0f, 240, 400) limitScaleRatio:3.0 title:@"上传素材"];
        [imgCropperVC setCompletionBlock:^(BOOL didFinished, UIImage *editedImage) {
            if (editedImage) {
                [imageDic setObject:editedImage forKey:[[NSNumber alloc] initWithLong:SelectBtn.hash]];
                [SelectBtn setBackgroundImage:editedImage forState:UIControlStateNormal];
                [SelectBtn setTitle:@"已上传" forState:UIControlStateNormal];
            }
        }];
        [self pushViewController:imgCropperVC];
    }];
}



#pragma mark -
#pragma mark --tableviewDelegate--
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 0;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *indentifier = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:indentifier];
    if (!cell) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:indentifier];
    }
    
    return cell;
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView *headView = _headView;
    return headView;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    UIView *headView = [self tableView:tableView viewForHeaderInSection:section];
    
    return CGRectGetHeight(headView.frame) + 20;
}
//-(void)scrollViewDidScroll:(UIScrollView *)scrollView {
//    [personalV.nameTF resignFirstResponder];
//    [personalV.IDNumberTF resignFirstResponder];
//    [personalV.PhoneNumberTF resignFirstResponder];
//    [personalV.streetTF resignFirstResponder];
//    [enterpriseV.TF1 resignFirstResponder];
//    [enterpriseV.TF2 resignFirstResponder];
//    [enterpriseV.TF3 resignFirstResponder];
//    [enterpriseV.TF4 resignFirstResponder];
//    [enterpriseV.TF5 resignFirstResponder];
//    [enterpriseV.TF6 resignFirstResponder];
//    [enterpriseV.TF7 resignFirstResponder];
//    [enterpriseV.TF8 ];
//    _headView.frame = self.view.frame;
//}
#pragma -
#pragma mark -- textdelegate --
-(BOOL)textFieldShouldBeginEditing:(UITextField *)textField {
    if (textField == enterpriseV.TF1 || textField == enterpriseV.TF2 || textField == enterpriseV.TF3 || textField == enterpriseV.TF4) {
        return YES;
    } else {
        _headView.frame = CGRectMake(CGRectGetMinX(_headView.frame), -100, CGRectGetWidth(_headView.frame), CGRectGetHeight(_headView.frame));
    }
    return YES;
}
-(BOOL)textFieldShouldEndEditing:(UITextField *)textField {
    
    return YES;
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
    [_tableView endEditing:YES];
    [_tableView.tableHeaderView endEditing:YES];
    [personalV endEditing:YES];
    [enterpriseV endEditing:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
